cmake_minimum_required(VERSION 3.21)
project(YUYVCapture)

set(CMAKE_CXX_STANDARD 17)

option(ENABLE_LOG "Enable logging" ON)

if(ENABLE_LOG)
    add_definitions(-DENABLE_LOG)
endif()

add_subdirectory(utils)

file(GLOB SRC_FILES src/*.cpp)
add_executable(yuyvtest ${SRC_FILES})

# 添加utils_obj对象
target_sources(yuyvtest PRIVATE $<TARGET_OBJECTS:utils_obj>)

target_include_directories(yuyvtest
    PRIVATE ${PROJECT_SOURCE_DIR}/include
    PRIVATE ${PROJECT_SOURCE_DIR}/utils
)

target_link_libraries(yuyvtest PRIVATE pthread)
target_link_libraries(yuyvtest PRIVATE dl)
target_link_libraries(yuyvtest PRIVATE rga)
